package com.semac.client.componentes.loading;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;
import com.semac.client.rpc.IsLoadingWidget;

public class Loading extends Composite implements IsLoadingWidget {

	private static LoadingUiBinder uiBinder = GWT.create(LoadingUiBinder.class);
	@UiField Label loadingTextField;

	interface LoadingUiBinder extends UiBinder<Widget, Loading> {
	}

	public Loading() {
		initWidget(uiBinder.createAndBindUi(this));
	}

	public void setText(String loadingText){
		this.loadingTextField.setText(loadingText);
	}

	@Override
	public void showLoading() {
		this.setVisible(true);
	}

	@Override
	public void hideLoading() {
		this.setVisible(false);
	}
}
